# TODO: add useful example to introduce class# Some function we have to decidedef useful_function(par1, par2, par3):# some loopfor i in par1:if par1 =="something":# do somethingelse:pass# or something elsereturnNone# or an object
Global vs. Local
Short interlude
Whole numbers: Integers int
type(1)
int
Real numbers: Floats float
type(1.0)
float
Most of the time it might not matter1
1==1.0
True
Sometimes there is a difference and we will see later why
Conditional statements
The important question of what to do “if” something happens.
Programming languages are languages
if something is True you should do something, else do something else
How to check if everything is true?
For loops
Enumerate
Range
List comprehension
Compare different functions
While loops
Perform a task while something is True
Be careful:
Some loops never finish (get stuck)
Make sure that condition for ending the loop can be fullfilled